package com.ssh.service;

import com.ssh.dao.IInformationDao;
import com.ssh.model.Information;


public class InformationService implements IInformationService {
	private IInformationDao informationDao=null;
	
	/* (non-Javadoc)
	 * @see com.ssh.service.IInformationService#save(com.ssh.model.Information)
	 */
	@Override
	public String save(Information i){
		try {
			informationDao.save(i);
			return "success";
		} catch (Exception e) {

			e.printStackTrace();
			return "error";
		}
	}

	/* (non-Javadoc)
	 * @see com.ssh.service.IInformationService#findById(java.lang.Integer)
	 */
	@Override
	public Information findById(java.lang.Integer id){
		return informationDao.findById(id);
	}

	/* (non-Javadoc)
	 * @see com.ssh.service.IInformationService#attachDirty(com.ssh.model.Information)
	 */
	@Override
	public String attachDirty(Information i){
		try {
			informationDao.attachDirty(i);
			return "success";
		} catch (Exception e) {

			e.printStackTrace();
			return "error";
		}
	}

	public IInformationDao getInformationDao() {
		return informationDao;
	}

	public void setInformationDao(IInformationDao informationDao) {
		this.informationDao = informationDao;
	}


}
